/**
 * 每个坦克
 */
public class Hero extends Tank{
    Shot shot = null;// 一个子弹
    public Hero(int x, int y) {
        super(x, y);
    }
    public void shotEnemy(){
        // 根据 hero的位置创建对象
        switch (getDirect()){
            case 0:
                shot = new Shot(getX()+20,getY(),0);
                shots.add(shot);
                break;
            case 1:
                shot = new Shot(getX()+60,getY()+20,1);
                shots.add(shot);
                break;
            case 2:
                shot = new Shot(getX()+20,getY()+60,2);
                shots.add(shot);
                break;
            case 3:
                shot = new Shot(getX(),getY()+20,3);
                shots.add(shot);
                break;
        }
        for (Shot shot : shots) {
            Thread t = new Thread(shot);
            t.start();
        }
    }

}
